﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;

namespace IndyCodeCamp.Controllers
{
    public interface ILogger
    {
        void Log(string message);
    }
    public class ConsoleLogger : ILogger
    {
        public void Log(string message)
        {
           Console.WriteLine(message); 
        }
    }
    [HandleError]
    public class HomeController : Controller
    {
        private ILogger _logger;
        public HomeController(ILogger logger)
        {
            _logger = logger;
        }

        public ActionResult Index()
        {
            ViewData["Message"] = "Welcome to ASP.NET MVC!";

            _logger.Log("in Index action");
            return View();
        }

        public ActionResult About()
        {
            return View();
        }
    }
}
